package com.chap9;

import javax.swing.*;
import java.awt.*;

public class DemoFlow extends JFrame {
    JButton jbWest,jbEast,jbNorth,jbSouth,jbCenter;
    public static void main(String[] args) {
        DemoFlow win=new DemoFlow();
    }
    public DemoFlow(){
        jbWest=new JButton("West");
        jbEast=new JButton("East");
        jbNorth=new JButton("North");
        jbSouth=new JButton("South");
        jbCenter=new JButton("Center");

        FlowLayout f1=new FlowLayout();
        f1.setAlignment(FlowLayout.CENTER);
        this.setLayout(f1);
        this.add(jbWest);
        this.add(jbEast);
        this.add(jbNorth);
        this.add(jbSouth);
        this.add(jbCenter);

        setTitle("MyFlow");
        this.setSize(400,500);
        this.setLocation(300,300);
        this.setVisible(true);
        this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
    }
}
